<template>
  <div>
    <h1 ref="h1">
      hello
    </h1>
    <input type="text" ref="input" />
    <!-- 父调子 -->
    <button @click="change()">click</button>
    <!-- 子组件 -->
    <Btn :title="'提交'" ref='btn'/>
  </div>
</template>

<script>
import Btn from "./Btn.vue"
export default {
  components:{ Btn },
  data() {
    return {

    }
  },
  methods: {
    // 父调子
    change() {
      this.$refs.h1.innerHTML = "123456"
      this.$refs.input.focus();
      this.$refs.input.style.color="blue";
      console.log(this.$refs.btn.name);
      console.log(this.$refs.btn.hander());
    }
  }
}
</script>

<style>

</style>
